home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
stats
/
chadyn.exe
/
YCOMY.C
< prev
next >
Wrap
Text File
|
1988-12-15
|
5KB
|
179 lines
/******************************* YCOMY.C **********************************/
/*************************** Y COMMANDS AND MENU *****************************/
/********************* (C) 1986,7,8 by JAMES A. YORKE ************************/
#include "yinclud.h"
menuY()
{
int i;
int minimum = ((eqn1 < dim) ? eqn1 : dim);
if(level == SETPARAM)
scr_clr(); /* in desmets pcio.a */
scr_rowcol(2, 0);
PRINT
"\n\nVectors-- y[]=current state, y1[]=cursor position, yx[] are for storage"
);
PRINT
"\nstate vec y[]; storage vec #1: y1[]; storage vec 2: y2[];\n");
for(i = 0; i < minimum; i++)
PRINT
" y[%d] = %lf; y1[%d] = %lf; y2[%d] = %lf;\n",
i, y[i], i, y[eqn0 + i], i, y[eqn0 + eqn1 + i]);
if(y[eqn0 + 2 * eqn1] != -9999.|| y[eqn0 + 3 * eqn1] != -9999.
|| y[eqn0 + 4 * eqn1] != -9999.)
{
PRINT
"storage vec #3: y3[]; storage vec 4: y4[]; storage vec 5: y5[];\n");
for(i = 0; i < minimum; i++)
PRINT
" y3[%d] = %lf; y4[%d] = %lf; y5[%d] = %lf;\n",
i, y[eqn0 + 2 * eqn1 + i], i, y[eqn0 + 3 * eqn1 + i],
i, y[eqn0 + 4 * eqn1 + i]);
}
if(ye[0] != -9999 || ya[0] != -9999
|| yb[0] != -9999)
{
PRINT
"storage vec a: ya[]; storage vec b: yb[]; storage vec e: ye[];\n");
for(i = 0; i < minimum; i++)
PRINT
" ya[%d] = %lf; yb[%d] = %lf; ye[%d] = %lf;\n",
i, ya[i], i, yb[i], i, ye[i]);
}
PRINT "\n SV: Set Values of a storage vector \n");
PRINT " M: Set one storage vector Equal to another \n");
PRINT " INIT: INITialize: change y to equal y1 \n");
PRINT
" Yx: list coordinates of yx[] where x = 0,1,...9 or = a,b,c,d,e \n\n");
}
int Ycommands(CodeName)
register char *CodeName;
{
int i,
outcome,
chr;
char ch;
double *py;
int minimum = ((eqn1 < dim) ? eqn1 : dim);
if(CodeName[0] == 'y' && (ch = CodeName[1]) != '\0'
&& CodeName[2] == '\0')
{
if(ch >= '0' && ch <= '9')
{
chr = ch - '0';
PRINT "storage vec #%c: y%c[] has values: \n"
, ch, ch);
for(i = 0; i < minimum; i++)
if(chr == 0)
PRINT
" y%c[%d] = %lf; \n", ch, i, y[i]);
else
PRINT
" y%c[%d] = %lf; \n", ch, i, y[eqn0 + (chr - 1) * eqn1 + i]);
}
else
if(ch >= 'a' && ch <= 'e')
{
if(ch == 'a')
py = ya;
if(ch == 'b')
py = yb;
if(ch == 'c')
py = yc;
if(ch == 'd')
py = yd;
if(ch == 'e')
py = ye;
PRINT
"storage vec #%c: y%c[] has values: \n", ch, ch);
for(i = 0; i < minimum; i++)
PRINT
" y%c[%d] = %lf; \n", ch, i, py[i]);
}
else
PRINT "y%c is not a storage vector\n\n", ch);
return(1);
}
TEST2("i","init")
{
interrupti();/* in YINTRPT.C -- initializes y */
return(1);
}
TEST("sv") {
outcome = ChooseStorageVec(0);
/* 0 means the character must be gotten
elsewhere */
if(outcome == 1)
while(ScanfForCoefs (0, dim, ystore_in))
{;
} /* keep on scanning for coefficients as long as
1 is being returned; the coordinates
acceptable are >= A = 0 and < B = dim; the
routine asks for a coordinate first; if it
is acceptable, it asks for a double
precision value to plug into the
corresponding coordinate; if succesful, and
coord < B-1, a 1 is retuned so inputting can
continue; otherwise 0 is returned; if the
routine is not successful in getting both a
coordinate and a double, pVec is not changed
*/
return(1);
}
TEST("m")
{
MoveVec();
return(1);
}
return(0);
}
interrupti()
{
stoplines(); /* for stopping drawing connected lines */
if(printer > 0)
if(images > 0) {
scr_rowcol(1, 0);
erase_line();
PRINT "Number of images of small cross WAS %d\n"
,images);
erase_line();
PRINT "Now number of images = 0\n");
}
images = 0;
start(); /* sets dot = 0 and lyap exponents are
restarted */
turnoff(BIGCROSS);
setequal(0, 1, eqn1);
/* Now if vec = y1 and the cross is turned off, then turn it on */
if (level > 2)
{
ResetScrnLineAtTop();
plotSomething(0);/* 0 means do not iterate map */
erase_line();
time0 = timeofday();
dotAtTime0 = dot;
PRINT "Current point: X=%12.12lf Y=%12.12lf\r",
plotX,plotY);
#ifndef MAINFRAME
if (cycle > 0)
{
SetCross(BIGCROSS);
}
#endif /* ifndef MAINFRAME */
}
}